import { Column, Entity } from 'typeorm';
import { PublicEntity } from '../../public.entity';


@Entity('access')
export class AccessEntity extends PublicEntity {
	
	@Column({
		type: 'varchar',
		nullable: true,
		length: 50,
		name: 'module_name',
		comment: '模块名称'
	})
	moduleName: string | null;


	@Column({
		type: 'enum',
		nullable: true,
		enum: ['1', '2', '3'],
		name: 'type',
		comment: '类型'
	})
	type: string | null;


	@Column({
		type: 'varchar',
		nullable: true,
		length: 100,
		name: 'action_name',
		comment: '操作名称'
	})
	actionName: string | null;


	@Column({
		type: 'varchar',
		nullable: true,
		length: 100,
		name: 'icon',
		comment: '小图标'
	})
	icon: string | null;


	@Column({
		type: 'varchar',
		nullable: true,
		length: 100,
		name: 'url',
		comment: 'url地址'
	})
	url: string | null;


	@Column({
		type: 'varchar',
		nullable: true,
		length: 10,
		name: 'method',
		comment: '请求方式'
	})
	method: string | null;


	@Column({
		type: 'int',
		nullable: false,
		default: () => -1,
		name: 'module_id',
		comment: '父模块id'
	})
	moduleId: number;


	@Column({
		type: 'varchar',
		nullable: true,
		length: 50,
		name: 'platform',
		comment: '平台'
	})
	platform: string | null;


	@Column({
		type: 'int',
		nullable: false,
		default: () => 1,
		name: 'sort',
		comment: '排序'
	})
	sort: number;


	@Column({
		type: 'varchar',
		nullable: true,
		length: 100,
		name: 'description',
		comment: '描素'
	})
	description: string | null;


	@Column({
		type: 'tinyint',
		nullable: true,
		default: () => 1,
		name: 'status',
		comment: '状态,1表示正常,0表示禁用'
	})
	status: number | null;
}
